home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Taifun
/
Taifun 048 (1988-02-15)(Ossowski, Stefan)(DE)(PD).zip
/
Taifun 048 (1988-02-15)(Ossowski, Stefan)(DE)(PD).adf
/
Mandel
/
source
/
menu.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-01-23
|
13KB
|
366 lines
#include <exec/types.h>
#include <intuition/intuition.h>
#define MENUFRONTPEN 2
/*
* Mandelbrot Construction Set V28.08.87
* ------------------------------------------------------------------------
*
* (C) 1987 By Olaf Seibert KosmoSoft Productions.
*/
/* First the menu texts */
/* (C) project options functions
* ------------------------------------------------------------
* About Mandel... new * colors * z^2 - c
* open... /O resolution * z*c*(1-z)
* save /S parameters z^3 + z*(c-1) - c
* save as...
* quit /Q
*
* new colors resolution
* -----------------------------------------------
* absolute pos'n /A select normal /1
* enlarge /E modulo 1/2 /2
* reduce /R ranges 1/3 /3
* shift /T palette /P 1/4 /4
* fill in /F
* hi-res /H
* interlace /L
* borderless /B
*/
struct IntuiText menuIText[] =
{
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,1,1,NULL, (UBYTE*)"About Mandel...", NULL }, /* 0 */
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,1,1,NULL, (UBYTE*)"New", NULL }, /* 1 */
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,1,1,NULL, (UBYTE*)"Open...", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,1,1,NULL, (UBYTE*)"Save", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,1,1,NULL, (UBYTE*)"Save As...", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,1,1,NULL, (UBYTE*)"Quit...", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,1,1,NULL, (UBYTE*)"Colors", NULL }, /* 6 */
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,1,1,NULL, (UBYTE*)"Resolution", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,1,1,NULL, (UBYTE*)"Parameters", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,CHECKWIDTH,1,NULL, (UBYTE*)"Z^2-C", NULL }, /* 9 */
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,CHECKWIDTH,1,NULL, (UBYTE*)"Z*C*(1-Z)", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,CHECKWIDTH,1,NULL, (UBYTE*)"Z^3+Z*(C-1)-C", NULL }
};
struct IntuiText newSubIT[] =
{ { MENUFRONTPEN,AUTOBACKPEN,JAM1,1,1,NULL, (UBYTE*)"Absolute", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,1,1,NULL, (UBYTE*)"Enlarge", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,1,1,NULL, (UBYTE*)"Reduce", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,1,1,NULL, (UBYTE*)"Shift", NULL },
};
struct IntuiText clrsSubIT[] =
{ { MENUFRONTPEN,AUTOBACKPEN,JAM1,CHECKWIDTH,1,NULL, (UBYTE*)"Select", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,CHECKWIDTH,1,NULL, (UBYTE*)"Modulo", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,CHECKWIDTH,1,NULL, (UBYTE*)"Ranges", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,CHECKWIDTH,1,NULL, (UBYTE*)"Palette", NULL }
};
struct IntuiText resSubIT[] =
{ { MENUFRONTPEN,AUTOBACKPEN,JAM1,CHECKWIDTH,1,NULL, (UBYTE*)"Normal", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,CHECKWIDTH,1,NULL, (UBYTE*)"1/2", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,CHECKWIDTH,1,NULL, (UBYTE*)"1/3", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,CHECKWIDTH,1,NULL, (UBYTE*)"1/4", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,CHECKWIDTH,1,NULL, (UBYTE*)"Fill In", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,CHECKWIDTH,1,NULL, (UBYTE*)"Hires", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,CHECKWIDTH,1,NULL, (UBYTE*)"Interlace", NULL },
{ MENUFRONTPEN,AUTOBACKPEN,JAM1,CHECKWIDTH,1,NULL, (UBYTE*)"BorderLess", NULL }
};
struct MenuItem newSubItem[] =
{ /* new submenu: */
#define MWIDTH 74 + COMMWIDTH /* Funny we need 2 more pixels */
#define MLEFT 40
/* absolute */
{ &newSubItem[1],
MLEFT,5,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | COMMSEQ,
0, /* mutual exclude */
(APTR) &newSubIT[0],NULL, /* Text in the box */
'A', NULL
},
/* enlarge */
{ &newSubItem[2],
MLEFT,15,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | COMMSEQ,
0, /* mutual exclude */
(APTR) &newSubIT[1],NULL, /* Text in the box */
'E', NULL
},
/* reduce */
{ &newSubItem[3],
MLEFT,25,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | COMMSEQ,
0, /* mutual exclude */
(APTR) &newSubIT[2],NULL, /* Text in the box */
'R', NULL
},
/* shift */
{ NULL,
MLEFT,35,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | COMMSEQ,
0, /* mutual exclude */
(APTR) &newSubIT[3],NULL, /* Text in the box */
'T', NULL
}
};
struct MenuItem colorSubItem[] =
#undef MWIDTH
#define MWIDTH CHECKWIDTH+64+COMMWIDTH
{ /* select */
{ &colorSubItem[1],
MLEFT,05,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX,
0, /* mutual exclude */
(APTR) &clrsSubIT[0],NULL, /* Text in the box */
NULL, NULL
},
/* modulo */
{ &colorSubItem[2],
MLEFT,15,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | CHECKIT | CHECKED,
1<<2, /* mutual exclude */
(APTR) &clrsSubIT[1],NULL, /* Text in the box */
NULL, NULL
},
/* ranges */
{ &colorSubItem[3],
MLEFT,25,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | CHECKIT,
1<<1, /* mutual exclude */
(APTR) &clrsSubIT[2],NULL, /* Text in the box */
NULL, NULL
},
/* palette */
{ NULL,
MLEFT,35,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | COMMSEQ,
0, /* mutual exclude */
(APTR) &clrsSubIT[3],NULL, /* Text in the box */
'P', NULL
}
};
#undef MWIDTH
#define MWIDTH CHECKWIDTH+88+COMMWIDTH
struct MenuItem resSubItem[] =
{ /* normal */
{ &resSubItem[1],
MLEFT,5,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | CHECKIT | CHECKED | COMMSEQ,
1<<1 | 1<<2 | 1<<3, /* mutual exclude */
(APTR) &resSubIT[0],NULL, /* Text in the box */
'1', NULL
},
/* 1/2 */
{ &resSubItem[2],
MLEFT,15,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | CHECKIT | COMMSEQ,
1<<0 | 1<<2 | 1<<3, /* mutual exclude */
(APTR) &resSubIT[1],NULL, /* Text in the box */
'2', NULL
},
/* 1/3 */
{ &resSubItem[3],
MLEFT,25,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | CHECKIT | COMMSEQ,
1<<0 | 1<<1 | 1<<3, /* mutual exclude */
(APTR) &resSubIT[2],NULL, /* Text in the box */
'3', NULL
},
/* 1/4 */
{ &resSubItem[4],
MLEFT,35,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | CHECKIT | COMMSEQ,
1<<0 | 1<<1 | 1<<2, /* mutual exclude */
(APTR) &resSubIT[3],NULL, /* Text in the box */
'4', NULL
},
/* fill in */
{ &resSubItem[5],
MLEFT,45,MWIDTH,15, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | COMMSEQ,
0, /* mutual exclude */
(APTR) &resSubIT[4],NULL, /* Text in the box */
'F', NULL
},
/* hi-res */
{ &resSubItem[6],
MLEFT,60,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | CHECKIT | MENUTOGGLE | COMMSEQ,
0, /* mutual exclude */
(APTR) &resSubIT[5],NULL, /* Text in the box */
'H', NULL
},
/* interlace */
{ &resSubItem[7],
MLEFT,70,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | CHECKIT | MENUTOGGLE | COMMSEQ,
0, /* mutual exclude */
(APTR) &resSubIT[6],NULL, /* Text in the box */
'I', NULL
},
/* borderless */
{ NULL,
MLEFT,80,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | CHECKIT | MENUTOGGLE | COMMSEQ,
0, /* mutual exclude */
(APTR) &resSubIT[7],NULL, /* Text in the box */
'B', NULL
};
#undef MLEFT
struct MenuItem MyMenuItem[] =
{ /* (C) menu: */
/* About Mandel... */
{ NULL,
0,0,120,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX,
0, /* mutual exclude */
(APTR) &menuIText[0],NULL, /* Text in the box */
NULL, NULL
},
/* project menu: */
/* new */
#undef MWIDTH
#define MWIDTH COMMWIDTH+70
{ &MyMenuItem[2],
0,0,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX,
0, /* mutual exclude */
(APTR) &menuIText[1],NULL, /* Text in the box */
NULL, (struct MenuItem *)&newSubItem[0]
},
/* open... */
{ &MyMenuItem[3],
0,10,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | COMMSEQ,
0, /* mutual exclude */
(APTR) &menuIText[2],NULL, /* Text in the box */
'O', NULL
},
/* save */
{ &MyMenuItem[4],
0,20,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | COMMSEQ,
0, /* mutual exclude */
(APTR) &menuIText[3],NULL, /* Text in the box */
'S', NULL
},
/* save as... */
{ &MyMenuItem[5],
0,30,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX,
0, /* mutual exclude */
(APTR) &menuIText[4],NULL, /* Text in the box */
NULL, NULL
},
/* quit */
{ NULL,
0,45,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | COMMSEQ,
0, /* mutual exclude */
(APTR) &menuIText[5],NULL, /* Text in the box */
'Q', NULL
},
/* options menu: */
#undef MWIDTH
#define MWIDTH 88
/* colors */
{ &MyMenuItem[7],
0,0,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX,
0, /* mutual exclude */
(APTR) &menuIText[6],NULL, /* Text in the box */
NULL, colorSubItem
},
/* resolution */
{ &MyMenuItem[8],
0,10,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX,
0, /* mutual exclude */
(APTR) &menuIText[7],NULL, /* Text in the box */
NULL, resSubItem
},
/* parameters */
{ NULL,
0,20,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX,
0, /* mutual exclude */
(APTR) &menuIText[8],NULL, /* Text in the box */
NULL, NULL
},
/* Functions Menu: */
#undef MWIDTH
#define MWIDTH CHECKWIDTH+104
/* Z^2 - C */
{ &MyMenuItem[10],
0,0,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | CHECKIT | CHECKED,
0x06, /* mutual exclude */
(APTR) &menuIText[9],NULL, /* Text in the box */
NULL, NULL
},
/* z*c*(1-z) */
{ &MyMenuItem[11],
0,10,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | CHECKIT,
0x05, /* mutual exclude */
(APTR) &menuIText[10],NULL, /* Text in the box */
NULL, NULL
},
/* z^3+z*(c-1)-c */
{ NULL,
0,20,MWIDTH,10, /* left top width height */
ITEMTEXT | ITEMENABLED | HIGHBOX | CHECKIT,
0x03, /* mutual exclude */
(APTR) &menuIText[11],NULL, /* Text in the box */
NULL, NULL
}
}; /* end of MyMenuItem[] */
#undef MWIDTH
struct Menu MandelMenu[] =
{ { &MandelMenu[1],
2,0,28,10, /* left top width height */
MENUENABLED,
" \xA9", /* (C) sign */
&MyMenuItem[0]
},
{ &MandelMenu[2],
30,0,70,10, /* left top width height */
MENUENABLED,
"Project",
&MyMenuItem[1]
},
{ &MandelMenu[3],
100,0,70,10, /* left top width height */
MENUENABLED,
"Options",
&MyMenuItem[6]
},
{ NULL,
170,0,90,10, /* left top width height */
MENUENABLED,
"Functions",
&MyMenuItem[9]
}
};